package com.mtung.dubbo.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

/**
 * dubbo的客户端处理
 * @author : zhenguo.yao
 * @date : 2020/3/23 0023 15:43
 */
public class DubboClientHandler extends ChannelInboundHandlerAdapter {

    private Object response;

    public Object getResponse() {
        return response;
    }

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        this.response = msg;
        //客户端获取服务器端响应之后主动关闭连接
        System.out.println("客户端获取服务器端的响应:" + this.response);
        ctx.close();
    }
}
